#ifndef CONFIG_H
#define CONFIG_H

#include <map>
#include <string>

#define SINGLETON_PATTERN

#define CLIENT_PRIKEY_FILEPATH "../../config/prikey.pem"
#define CLIENT_CERT_FILEPATH "../../config/client_cert.pem"
#define CA_CERT_FILEPATH "../../CA/ca.crt"
#define OPERATION_SUCCESS(operation, object, data) \
    do { \
        std::cout << "[" << CURRENT_TIME << "] Operation: " << operation << "\n" \
                  << "    Object: " << object << "\n" \
                  << "    Status: " \
                  << "SUCCESS" \
                  << "\n"; \
        if (!(std::string(data).empty())) { \
            std::cout << "    Data: " << data << "\n"; \
        } \
        std::cout << std::endl; \
    } while (0)

#define OPERATION_FAIL(Failure_reason, object, file, line, data) \
    do { \
        std::cerr << "[" << CURRENT_TIME << "] Failure reason: " << Failure_reason << "\n" \
                  << "    Object: " << object << "\n" \
                  << "    Status: FAIL\n" \
                  << "    File: " << file << "\n" \
                  << "    Line: " << line << "\n"; \
        if (!(std::string(data).empty())) { \
            std::cerr << "    Data: " << data << "\n"; \
        } \
        std::cerr << std::endl; \
    } while (0)

inline std::map<std::string, std::string> issuerInfo = {
    {"C", "CN"},                                           // 国家
    {"ST", "SICHUAN"},                                     // 州
    {"L", "ChengDu"},                                      // 城市
    {"O", "Xihua University"},                             // 组织名称
    {"OU", "School of Computer and Software Engineering"}, // 组织单位
    {"CN", "Regional Transportation Authority(RTA)"},      // 公共名称（通常是 CA 名称）
};

inline std::map<std::string, std::string> subjectInfo = {
    {"C", "CN"},                                           // 国家
    {"ST", "SICHUAN"},                                     // 州
    {"L", "ChengDu"},                                      // 城市
    {"O", "Xihua University"},                             // 组织名称
    {"OU", "School of Computer and Software Engineering"}, // 组织单位
    {"CN", "VideoMetting Client"}, // 公共名称（通常是域名或设备名称）
};

#endif // CONFIG_H
